package 字符缓冲流功能复制Java文件;

import java.io.*;

public class CopyJavaDemo {
    public static void main(String[] args) throws IOException {
        BufferedReader br=new BufferedReader(new FileReader("D:\\javajhx\\IO\\src\\字符缓冲流功能\\BufferStreamDemo.java"));
        BufferedWriter bw=new BufferedWriter(new FileWriter("copy.java"));

        String line;
        while((line=br.readLine())!=null){
            bw.write(line);
            bw.newLine();//写行分隔符
            bw.flush();
        }

        br.close();
        bw.close();
    }
}
